<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

<sec:authorize access="isAuthenticated()" var="isAuthenticated"/>
<c:choose>
    <c:when test="${isAuthenticated}">
        <ul id="leftList">
            <li><h4><spring:message code="label.left.header.personal"/></h4></li>
            <li>
                <table>
                    <tbody>
                        <tr>
                            <td class="leftMenuItem viewProfileLink" onclick="window.location='/users/<sec:authentication property="principal.id"/>'">
                                <spring:message code="label.left.page"/>
                            </td>
                            <td class="leftMenuItem editProfileLink" onclick="window.location='/users?form'">
                                <spring:message code="label.left.page.edit"/>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </li>
            <li onclick="window.location='/friends'">
                <div class="leftMenuItem"><spring:message code="label.left.friends"/></div>
            </li>
            <li onclick="window.location='/msg'">
                <div class="leftMenuItem"><spring:message code="label.left.msg"/></div>
            </li>

            <li><h4><spring:message code="label.left.header.work"/></h4></li>
            <li onclick="window.location='/objects'">
                <div class="leftMenuItem"><spring:message code="label.left.objects"/></div>
            </li>
            <li onclick="window.location='/docs'">
                <div class="leftMenuItem"><spring:message code="label.left.papers"/></div>
            </li>

            <li><h4><spring:message code="label.left.header.settings"/></h4></li>
            <li onclick="window.location='/settings'">
                <div class="leftMenuItem"><spring:message code="label.left.settings"/></div>
            </li>
        </ul>
    </c:when>
    <c:otherwise>
        <jsp:include page="../login.jsp"/>
    </c:otherwise>
</c:choose>